#ifndef G_FILE_UTILS_H
#define G_FILE_UTILS_H
/*
gfileutils.h
18/05/2014
psycommando@gmail.com

Description:
Header file with some handy tools for working with files.
Is as portable and simple as possible.

No crappyrights. All wrongs reversed!
*/
#include <string>

namespace g { namespace fileutils 
{

	/* 
		Name: CreateDir
		In : 
			- const string & path : Path to the directory to create. 
		Out: 
			- none

		Description: Portable directory creation function. Uses the OS's "mkdir" command currently.
	*/
	void CreateDir( const std::string & path );


	/* 
		*has_suffix
		*In : 
			- const string &str		: string to search for the suffix.
			- const string &suffix	: string containing the suffix to look for.
		*Out: 
			- bool					: Whether the suffix was found or not.

		*Description: Compare the end of a string with another string containg a suffix, and return true if the 
					  suffix matches the end of the string.
	*/
	bool has_suffix(const std::string &str, const std::string &suffix);


    //Take a path to a file, and return the path without the filename+extension, or else the exact same path
	std::string GetPathOnly( const std::string & fullpath );

    //Take a path, and return only the filename+extension if there is one! Else returns empty string.
    std::string GetFilenameFromPath( const std::string & fullpath );

    //Returns the path without the file extension if there is one, or else the exact same path
	std::string GetPathWithoutFileExt( const std::string & fullpath );

}; };

#endif